package com.ares.aler.controllr;

import com.ares.aler.service.AdminNavDao;
import com.ares.aler.service.NavDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/*
*  后台管理的跳转
*
*  只负责跳转，不负责逻辑
*  每个模块的逻辑业务去相应的controller
*
 */
@Controller
public class adminInitController {

    @Autowired
    NavDao navDao ;
    @Autowired
    AdminNavDao adminNavDao ;

    //后台管理首页
    @RequestMapping("adminInit")
    public String adminInit(Model model){
        List<Map<String, Object>> navTree = adminNavDao.navTree();
        model.addAttribute("navTree", navTree);
        return "system/admin/adminIndex";
    }

    /**
     * 跳转用户管理页面
     * @return
     */
    @RequestMapping("useradmin")
    public String userAdmin(){
        return "system/admin/UserAdmin";
    }

    /**
     * 导航栏管理页面
     * @return
     */
    @RequestMapping("navadmin")
    public String navadmin(){
        return "system/admin/navAdmin";
    }

}
